import {hrAjax as proFetch} from 'src/hrpub/common/utils/utils';
import {toast} from 'nc-lightapp-front';

export default function sendOpinionMsg(callback) {
    const {json, orgVal} = this.props;
    const checkedData = this.props.editTable.getCheckedRows('contopiniongrid');
    let param = {
        pk_org: orgVal.refpk,
        sendCheck: "N",
        contopiniongrid: {
            rows: checkedData.map(item => item.data)
        }
    };
    return proFetch({
        url: '/nccloud/hrcm/contopinion/OpinionRemcSendMsgAction.do',
        body: param
    }).then((res) => {
        if (res.success) {
            toast({color: "success", content: res.data});
            callback && callback();
        }
    });
}
